<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
	<style type="text/css">
		body, html{width: 100%;height: 100%;margin:0;font-family:"微软雅黑";}
		#allmap{height:100%;width:100%;}
		#r-result{width:100%; font-size:14px;}
	</style>
	<script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=dfXzQnlq8IH6Uq0GLqFbKzllfc3lfarM"></script>
	<title>治电领导人防御与攻击系统</title>
</head>
<body>
	<center><h1 style="color:#B52026;">治电领导人防御<a onclick="fangyu()"><img src="dp.png" style="width:50px;height:50px;"></a>与攻击<a onclick="gongji()"><img src="dw.png" style="width:50px;height:50px;"></a>系统<span style="color:#B52026; margin-left:30px;font-size:15px;">进入寻迹系统<a href="xunji.html"><img src="gj.png" style="width:50px;height:50px;"></a></span></h1></center>
	<div id="allmap"></div>
	<div id="r-result">


	</div>
	<script src="bmob-min.js"></script>
</body>
</html>
<script type="text/javascript">
	// 百度地图API功能
	var map = new BMap.Map("allmap");
	map.setMapStyle({style:'redalert'});
	map.centerAndZoom(new BMap.Point(117.844522,30.970232),11);
	map.enableScrollWheelZoom(true);
	


    Bmob.initialize("05297f9b328c80d8e9721c3f2c6ac49b", "289faf523899ee4e0b7e1d1942fa132b");
 
var GameScore = Bmob.Object.extend("GameScore");
var query = new Bmob.Query(GameScore);

function fangyu(){
	map.clearOverlays();    //清除地图上所有覆盖物
	var myIcon = new BMap.Icon("dpb.png", new BMap.Size(50,50));
	query.select("jin", "wei");
	query.find().then(function(results) {
	 
		var a = results[results.length-1].get('jin');
	    var b = results[results.length-1].get('wei');
	    var vectorFOArrow = new BMap.Marker(new BMap.Point(a,b), {
	  icon:myIcon
	});
	 vectorFOArrow.addEventListener("click",attribute);
	map.addOverlay(vectorFOArrow);
	map.setViewport({center:new BMap.Point(a,b),zoom:14});
	 var opts={  
	   width:200,//信息窗口宽度height:100,//信息窗口高度  
	   title:"张辉治先生"//信息窗口标题  
	}
	function attribute(){
	  var sContent ="<h4 style='color:#B52026;'><img src=\"dp.png\" style=\"width:50px;height:50px;\"><span style=\"margin-top:-10px;\">张辉治先生</span></h4>";
	  var point1 = new BMap.Point(a,b);
	    var infoWindow=new BMap.InfoWindow(sContent);//创建信息窗口对象   
	    map.openInfoWindow(infoWindow,point1 );//打开信息窗口    
	  }
	});
}


function gongji(){
	map.clearOverlays();    //清除地图上所有覆盖物
	var myIcon = new BMap.Icon("dwp.png", new BMap.Size(50,50));
	query.select("jin", "wei");
	query.find().then(function(results) {
	 
		var a = results[results.length-1].get('jin');
	    var b = results[results.length-1].get('wei');
	    var vectorFOArrow = new BMap.Marker(new BMap.Point(a,b), {
	  icon:myIcon
	});
	 vectorFOArrow.addEventListener("click",attribute);
	map.addOverlay(vectorFOArrow);

	map.setViewport({center:new BMap.Point(a,b),zoom:14})
	 var opts={  
	   width:200,//信息窗口宽度height:100,//信息窗口高度  
	   title:"任治中先生"//信息窗口标题  
	}
	function attribute(){
	  var sContent ="<h4 style='color:#B52026;'><img src=\"dw.png\" style=\"width:50px;height:50px;\"><span style=\"margin-top:-10px;\">任治中先生</span></h4>";
	  var point1 = new BMap.Point(a,b);
	    var infoWindow=new BMap.InfoWindow(sContent);//创建信息窗口对象   
	    map.openInfoWindow(infoWindow,point1 );//打开信息窗口    
	  }

	});
}
var myIcon = new BMap.Icon("dpb.png", new BMap.Size(50,50));
query.select("jin", "wei");
query.find().then(function(results) {
 
	var a = results[results.length-1].get('jin');
    var b = results[results.length-1].get('wei');
    var vectorFOArrow = new BMap.Marker(new BMap.Point(a,b), {
  icon:myIcon
});
 vectorFOArrow.addEventListener("click",attribute);
map.addOverlay(vectorFOArrow);
map.setViewport({center:new BMap.Point(a,b),zoom:14})
 var opts={  
   width:200,//信息窗口宽度height:100,//信息窗口高度  
   title:"张辉治先生"//信息窗口标题  
}
function attribute(){
  var sContent ="<h4 style='color:#B52026;'><img src=\"dp.png\" style=\"width:50px;height:50px;\"><span style=\"margin-top:-10px;\">张辉治先生</span></h4>";
  var point1 = new BMap.Point(a,b);
    var infoWindow=new BMap.InfoWindow(sContent);//创建信息窗口对象   
    map.openInfoWindow(infoWindow,point1 );//打开信息窗口    
  }

 setInterval("fangyu()",500000);
 //    // 用经纬度设置地图中心点
	// map.clearOverlays(); 
	// var new_point = new BMap.Point(a,b);
	// var marker = new BMap.Marker(new_point);  // 创建标注
	// map.addOverlay(marker);              // 将标注添加到地图中
	// map.panTo(new_point);  
});
</script>
